Skip to content

Security: Potential Information Disclosure via phpinfo() Endpoint#1003

Open
tomaioo wants to merge 1 commit into
nextcloud:masterfrom
tomaioo:fix/security/potential-information-disclosure-via-php
Open

Security: Potential Information Disclosure via phpinfo() Endpoint#1003
tomaioo wants to merge 1 commit into
nextcloud:masterfrom
tomaioo:fix/security/potential-information-disclosure-via-php

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 25, 2026

Summary

Security: Potential Information Disclosure via phpinfo() Endpoint

Problem

Severity: Medium | File: lib/Controller/PageController.php:L47

The PageController exposes a phpinfo() endpoint that renders PHP configuration details when enabled via app config. While protected by a config flag, if enabled, phpinfo(INFO_ALL & ~INFO_ENVIRONMENT & ~INFO_VARIABLES) still exposes extensive server information including loaded extensions, compilation options, and server paths. This could aid attackers in reconnaissance. The PhpInfoResponse class sets ContentSecurityPolicy and FeaturePolicy but the raw phpinfo output still contains sensitive data.

Solution

Consider removing or heavily restricting this endpoint. If needed for debugging, require admin authentication and log access. Evaluate if the INFO_MODULES flag might still expose sensitive extension versions.

Changes

  • lib/Controller/PageController.php (modified)

The PageController exposes a phpinfo() endpoint that renders PHP configuration details when enabled via app config. While protected by a config flag, if enabled, phpinfo(INFO_ALL & ~INFO_ENVIRONMENT & ~INFO_VARIABLES) still exposes extensive server information including loaded extensions, compilation options, and server paths. This could aid attackers in reconnaissance. The PhpInfoResponse class sets ContentSecurityPolicy and FeaturePolicy but the raw phpinfo output still contains sensitive data.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant